﻿using Microsoft.EntityFrameworkCore;
using MultiTenant.SeparateSchema.Api.Models;

namespace MultiTenant.SeparateSchema.Api.Data.Context;

public class MigrationDbContext(
	DbContextOptions<MigrationDbContext> options)
	: DbContext(options)
{
	
	protected override void OnModelCreating(ModelBuilder builder)
	{
		base.OnModelCreating(builder);
		builder.Entity<Product>().ToTable("Products");
		builder.Entity<Product>().Property(p => p.Id).ValueGeneratedOnAdd();
		builder.Entity<Product>().Property(p => p.Name).HasMaxLength(100).IsRequired();
	}
}
